<!-- saved from url=(0022)http://internet.e-mail -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>While Statement</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../edit68k.css" rel="stylesheet" type="text/css">
</head>

<body class="text">
<p class="heading">Structured Control - While <br>
<hr noshade>
<p><b>While</b> - Loops through the commands specified while the &lt;expression&gt;
is true.</p>
<p>The While statement has the following syntax:</p>
<p class="sourcecode">WHILE[.<i>size</i>] <i>expression</i> DO[.<i>extent</i>]<br>
&nbsp;&nbsp; <i>code</i><br>
ENDW</p>
<p><b><i>size</i></b> - The value B, W, or L, specifying the size
of the operand comparison.&nbsp; These values correspond to the Byte, Word, or
Long word data size.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A size may not be specified when the expression consists of only a condition 
code.</p>
<p><b><i>expression</i></b> - The expression tested.&nbsp; For a
description of the expression syntax, see the <a href="exsyntax.htm"> Expression Syntax</a>
page.</p>
<p><b><i>extent</i></b> - Optional value S or L, indicating the size of 
the forward branch to use (short or long).</p>
<p><b><i>code</i></b> - The series of assembly commands
executed continually while the expression is true.</p>
<p>One space should be used to separate each part of the statement.</p>
<p class="subheading">===Notes===</p>
<p>If <i><b>expression</b></i> is false upon entry, the <i><b>code</b></i> 
instructions
are never executed.</p>
<p>An <i><b>expression</b></i> of &lt;T&gt; is used to create an 
infinite loop.</p>
<p class="sourcecode">WHILE &lt;T&gt; DO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
infinite loop<br>
&nbsp;&nbsp; <i>code</i><br>
ENDW</p>
<p>The CCR's (condition code register) flags are set and tested by
using this command before the <i><b>code</b></i> instructions are executed if at
all.</p>
<p><b>EXAMPLE</b></p>
<p class="sourcecode">WHILE.B D0 &lt;LT&gt; #5 DO.S<br>
&nbsp; <i>code</i><br>
ENDW</p>
<p>&nbsp;</p>
</body>
</html>